/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */

package com.haulmont.asu.entity;

import com.haulmont.chile.core.annotations.Composition;
import com.haulmont.chile.core.annotations.NamePattern;
import com.haulmont.cuba.core.entity.StandardEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.util.List;

/**
 * Author: Sergey42
 * Date: 14.10.13 12:10
 */
@Table(name = "EXT_CORPORATION")
@Entity(name = "ext$Corporation")
@NamePattern("%s|name")
public class Corporation extends StandardEntity {

    private static final long serialVersionUID = 7141126692605185588L;

    @Column(name = "NAME", length = 100)
    protected String name;

    @OneToMany(mappedBy = "corporation")
    @Composition
    protected List<CorporationPresenter> corporationPresenters;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<CorporationPresenter> getCorporationPresenters() {
        return corporationPresenters;
    }

    public void setCorporationPresenters(List<CorporationPresenter> corporationPresenters) {
        this.corporationPresenters = corporationPresenters;
    }
}
